import * as homeApi from './service';

export default {
  namespace: 'goods',
  state: {
    list: [],
    page: 1,
  },
  effects: {
    * load(_, {put}) {
        yield put({ 
            type: 'save',
            payload: {
                list: [{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                },{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                },{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                },{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                },{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                },{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                },{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                },{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                },{
                    cover_image: 'https://img.yzcdn.cn/upload_files/2017/04/28/FhtKOLDXXL0X0lk_eQ8w6P-EAhTu.jpg?imageView2%2F2%2Fw%2F520%2Fh%2F0%2Fq%2F75%2Fformat%2Fwebp',
                    price: 129,
                    title: '没想稻五常稻花香大米 10斤装',
                }]
            } 
        });
    },
  },
  reducers: {
    save(state, { payload }) {
      return {...state, ...payload};
    },
  },
};